home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 31
/
Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso
/
Aminet
/
dev
/
gui
/
gui4cli.lha
/
Gui4Cli
/
Dir
/
dir.ppshow
< prev
next >
Wrap
Text File
|
1999-04-21
|
5KB
|
235 lines
G4C
; this is a GUI for the excellent and free Graphics and ANIM player PPShow 4
; (it also works with older versions of ppshow)
WINBIG -1 30 340 132 "PPShow 4.0 GUI"
wintype 11110001 ; a resizable window
;winbackground icon guis:info/bgnds/tile 0
varpath dir.gc
;============================> Some Graphics (to fill in space)
box 0 0 0 0 IN ICONDROP
LINE 6 65 332 65 1
LINE 6 67 332 67 2
LINE 6 100 332 100 1
LINE 6 102 332 102 2
;============================> AppWindow
xONLOAD ; Set the default values of our vars
setscreen dir.ppshow $*SCREEN
mode = PAL ; screen mode
res = "" ; resolution
play = "" ; loop/repeat
lace = "" ; interlace or not (use default)
flick = "" ; flicker fix (use default)
datt = "" ; use datatypes
mouse = NOMOUSE ; no mouse
oscn = "" ; overscan (use default)
cycle = "" ; cycle (use default)
noan = "" ; display animations
jifs = 0 ; Jiffies -> 0 = use default
times = 100 ; play anims 100 times
time = 60 ; show pics for 60 secs each
guiopen dir.ppshow
xonclose
guiquit dir.ppshow
xonfail
guiquit dir.ppshow
;====================> Declare a cycler, to let the user
; choose the type of monitor.
xCYCLER 205 5 121 12 "" mode
CSTR PAL PAL
CSTR NTSC NTSC
CSTR A2024 A2024
CSTR 15Hz 15Hz
CSTR VGA VGA
CSTR SUPER72 SUPER72
;Note that we set PAL first. That's because I use PAL, and want it
;as default - change it around if you want otherwise.
;===================> An other cycler for the Resolution Modes
xCYCLER 60 5 125 12 Res. res
CSTR Default ""
CSTR HAM HAM
CSTR LOW LO
CSTR HIGH HI
CSTR "Super HIGH" SHI
CSTR Productive PROD
;===================> Cycler for Loop/Repeat/Single play of anims
xCYCLER 205 20 121 12 "" play
CSTR SINGLE ""
CSTR LOOP LOOP
CSTR REPEAT R
;====================> Declare some checkbox button for lace, mouse, oscn etc
xCHECKBOX 60 20 26 11 Lace lace L NL OFF
xCHECKBOX 140 20 26 11 NoFlk flik NF "" OFF
xCHECKBOX 60 35 26 11 DTyp datt DT "" OFF
xCHECKBOX 140 35 26 11 Mouse mouse "" NOMOUSE OFF
xCHECKBOX 220 35 26 11 Oscn oscn MO NO OFF
xCHECKBOX 300 35 26 11 Cycle cycle CYCLE "" OFF
;-----> Slider for Time (seconds to show each picture)
xHSLIDER 60 50 200 11 Time time 1 999 60 "%3ld Sec."
GadID 10
;=================== ANIMATION OPTIONS ==============================
;----> Checkbox for Animation ON/OFF (also jifs/times slider ON/OFF)
xCHECKBOX 60 73 26 11 Anim noan "" NOANIM ON
if $noan = ""
SetGad dir.ppshow 15 ON
setgad dir.ppshow 11 ON
else
SetGad dir.ppshow 15 OFF
setgad dir.ppshow 11 OFF
endif
;----> Slider for speed
xHSLIDER 87 73 170 11 "" jifs 0 10 0 "%2ld Jfs"
GadID 15
;-----> Slider for Times to play
xHSLIDER 60 86 200 11 Times times 1 999 100 "%3ld"
GadID 11
;=========================== Play the mess!
; Here we use some tricks to feed the files to ppshow 20 at a time, so
; we don't load and reload ppshow for every file. We use xOnReturn to
; re-launch ppshow when it's done showing each batch of files
xbutton 15 110 80 15 PLAY
id = $$LV.ID ; get the listview's id
dir = $$LV.DIR
lvuse dir.gc $id
lvmulti first ; get first file
if $lv_file = ""
ezreq "How's about choosing\nsome files first ?" 'Oh yeah..' ""
stop
endif
if $$LV.TYPE != FILE
ezreq "Please choose files\nnot directories." OK ""
stop
endif
cd $dir ; cd to the current directory
abort = 0 ; a flag to tell us to stop
; ok.. now collect the first 20 files
num = 0 ; start a counter
files = ""
while $num < 20
extract lv_file ext ext
cutvar ext copy char 5 rext
if $rext != ".info"
extract lv_file file file
appvar files ' $file'
counter num inc 1
endif
lvmulti next
if $lv_file = "" ; no more files
num = 20
abort = 1
endif
endwhile
gosub dir.ppshow makecom
launch 1 'ppshow >nil: $files $com'
xOnReturn 1
if $abort = 1 ; check Stop flag
stop
endif
num = 0 ; re-start counter
files = ""
lvmulti next
if $lv_file = ""
stop
endif
while $num < 20
extract lv_file ext ext
cutvar ext copy char 5 rext
if $rext != ".info"
extract lv_file file file
appvar files ' $file'
counter num inc 1
endif
lvmulti next
if $lv_file = ""; no more files
num = 20
abort = 1
ext = ""
endif
endwhile
gosub dir.ppshow makecom
launch 1 'ppshow >nil: $files $com'
; ---------- Abort after returning from current ppshow launch (set flag)
xbutton 255 110 70 15 Stop
abort = 1
; ----------- Routine to construct the rest of the command line
xRoutine makecom
com = $mode ; screen mode
if $res > ""
appvar com ' $res' ; screen resolution
endif
if $play > ""
appvar com ' $play' ; play single/loop etc for anims
endif
appvar com ' $lace' ; interlace or not
if $flick > ""
appvar com ' $flick' ; ficker fix
endif
if $datt > ""
appvar com ' $datt' ; use datatypes
endif
if $mouse > ""
appvar com ' $mouse' ; show mouse ?
endif
appvar com ' $oscn' ; max or no overscan ?
if $cycle > ""
appvar com ' $cycle' ; cycle
endif
appvar com ' TIME=$time' ; time to play pics
if $noan = "" ; i.e. display animations
if $jifs > 0 ; 0 = use default
appvar com ' J=$jifs'
endif
appvar com ' T=$times'; times to play anim
endif